<?php

namespace App\Http\Requests\Station\NetworkExpress;

use Illuminate\Foundation\Http\FormRequest;

class NetworkExpressCreate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 定义表单规则
     *
     * Date: 13/04/2018
     * @author Tenny
     * @return array
     */
    public function rules()
    {
        return [
            'designation' => 'required',
            'name' => 'required',
            'phone' => 'required',
            'province_id' => 'required',
            'city_id' => 'required',
            'district_id' => 'required',
            'service_money' => 'required',
            'service_img' => 'required',
            'region' => 'required',
            'pid' =>  'required',
            'not_region' => 'required',
            'region_mark' => 'nullable',
        ];
    }

    /**
     * 定义错误响应消息
     *
     * Date: 13/04/2018
     * @author Tenny
     * @return array
     */
    public function messages()
    {
        return [
            'designation.required' => '请输入标题',
            'name.required' => '请输入文章内容',
        ];
    }
}
